package com.china08.yxyapi.entity.db.lessons;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.china08.yxyapi.entity.BaseEntity;

/**
 * 校本课程的授权
 * 
 * @author Richard.Wang
 * 
 */
@Entity
@Table(name = "yxy_lessons_school_lesson_auth", catalog = "yxy_lessons", indexes = { @Index(columnList = "school_id"), @Index(columnList = "user_id") }, //
uniqueConstraints = { @UniqueConstraint(columnNames = { "school_id", "user_id", "lesson_id" }) })
public class YxyLessonsSchoolLessonAuth extends BaseEntity {

    private static final long serialVersionUID = -1605776757706297487L;

    /** 学校:ID */
    @Column(name = "school_id", length = 32, nullable = false)
    private String schoolId;

    /** 用户:ID, 只能为 学生id */
    @Column(name = "user_id", length = 32, nullable = false)
    private String userId;

    /** 用户:ID, 只能为 学生id */
    @Column(name = "user_nick", length = 32, nullable = false)
    public String userNick;

    @Column(name = "username", length = 32, nullable = false)
    public String userName;

    @Column(name = "class_id", length = 32, nullable = false)
    public String classId;

    @Column(name = "class_name", length = 32, nullable = false)
    public String className;

    @Column(name = "guardian_id")
    public String guardianId;

    @Column(name = "guardian_name", length = 32, nullable = false)
    public String guardianName;

    @Column(name = "last_auto_date")
    public Date lastAutoDate;

    /** 课程:ID */
    @Column(name = "lesson_id", length = 32, nullable = false)
    private String lessonId;

    /** 状态:0-未授权,1-已授权 */
    @Column(name = "status", columnDefinition = "int(1) DEFAULT 1 COMMENT '状态:0-未授权,1-已授权'", nullable = false)
    private Integer status = 1;

    // getters and setters
    public String getUserId() {
        return userId;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getLessonId() {
        return lessonId;
    }

    public void setLessonId(String lessonId) {
        this.lessonId = lessonId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(String schoolId) {
        this.schoolId = schoolId;
    }

    public String getUserNick() {
        return userNick;
    }

    public void setUserNick(String userNick) {
        this.userNick = userNick;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getClassId() {
        return classId;
    }

    public void setClassId(String classId) {
        this.classId = classId;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getGuardianId() {
        return guardianId;
    }

    public void setGuardianId(String guardianId) {
        this.guardianId = guardianId;
    }

    public String getGuardianName() {
        return guardianName;
    }

    public void setGuardianName(String guardianName) {
        this.guardianName = guardianName;
    }

    public Date getLastAutoDate() {
        return lastAutoDate;
    }

    public void setLastAutoDate(Date lastAutoDate) {
        this.lastAutoDate = lastAutoDate;
    }
}
